package com.tzt.common;

import java.util.HashMap;
import java.util.Map;

public class BaseController
{

    /**
     * <功能详细描述> 参数失败返回信息
     * @param message
     * @return
     * @see [类、类#方法、类#成员]
     */
    public Map<String, Object> paramFailedMessage()
    {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("code", "1");
        map.put("msg", "参数异常");
        map.put("data", null);
        return map;
    }

    /**
     * <功能详细描述> 成功返回数据
     * @param data
     * @return
     * @see [类、类#方法、类#成员]
     */
    public Map<String, Object> successData(Map<String, Object> data)
    {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("code", "0");
        map.put("msg", "处理成功");
        map.put("data", data);
        return map;
    }

    /**
     * <功能详细描述> 返回失败数据
     * @param data
     * @return
     * @see [类、类#方法、类#成员]
     */
    public Map<String, Object> failedData(Map<String, Object> data, String code, String msg)
    {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("code", code);
        map.put("msg", msg);
        map.put("data", data);
        return map;
    }

}
